home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagd_f.zip / EGAVGA.SWG / 0146_Copper Bar Effects.pas < prev    next >
Pascal/Delphi Source File  |  1995-03-03  |  2KB  |  73 lines

  1. {
  2. > I'm trying to do a copper bars effect in Turbo Pascal. At
  3. > the moment, I have three different coloured _LINES_ which go
  4. > up and down etc. etc.
  5.  
  6. Here is a copper-car-routine which I found in an old issue of an german
  7. computer-magazine. Maybe it helps you..:
  8. }
  9. {$A+,B-,D-,E-,F-,G+,I-,L-,N-,O-,R-,S-,V-,X-}       { For TP 6.0 }
  10. Program RedBar;
  11. Uses
  12.   Crt;
  13.  
  14. Var
  15.   C       : Byte;
  16.   C2,
  17.   C3,
  18.   C4      : Word;
  19.   SinTab  : Array [0..127] of Word;
  20.   HeadPtr : Word Absolute $0040:$001A;
  21.   TailPtr : Word Absolute $0040:$001C;
  22.   Zaehler : Word;
  23.  
  24. Begin
  25.   For C := 0 to 127 do
  26.     SinTab[C] := Trunc((Sin((2 * Pi / 128) * C) + 1) * 135);
  27.  
  28.   C3 := 0;
  29.  
  30.   Repeat
  31.     Inline($FA);   {CLI}
  32.  
  33.     Repeat Until (Port[$3DA] and 8) > 0;
  34.     Repeat Until (Port[$3DA] and 8) = 0;
  35.  
  36.     For C4 := 0 to SinTab[C3 and 127] do
  37.     Begin
  38.       Repeat Until (Port[$3DA] and 1) = 0;
  39.       Repeat Until (Port[$3DA] and 1) > 0;
  40.     End;
  41.  
  42.     For C := 0 to 63 do
  43.     Begin
  44.       Repeat Until (Port[$3DA] and 1) > 0;
  45.       Port[$3C8] := 0;
  46.       Port[$3C9] := 0;
  47.       Port[$3C9] := C;
  48.       Port[$3C9] := 63-C;
  49.       Repeat Until (Port[$3DA] and 1) = 0;
  50.     End;
  51.  
  52.     For C := 63 downTo 0 do
  53.     Begin
  54.       Repeat Until (Port[$3DA] and 1) > 0;
  55.       Port[$3C8] := 0;
  56.       Port[$3C9] := 0;
  57.       Port[$3C9] := C;
  58.       Port[$3C9] := 63-C;
  59.       Repeat Until (Port[$3DA] and 1) = 0;
  60.     End;
  61.  
  62.     Inc(C3);
  63.     Inline($FB); {STI}
  64.  
  65.   Until HeadPtr <> TailPtr;
  66.  
  67.   HeadPtr := TailPtr;
  68.   Port[$3C8] := 0;
  69.   Port[$3C9] := 0;
  70.   Port[$3C9] := 0;
  71.   Port[$3C9] := 0;
  72. End.
  73.